var ec_right2 = echarts.init(document.getElementById('r2'),'macarons');

// var ddd = [{'name': '肺炎', 'value': '12734670'}, {'name': '实时', 'value': '12734670'},
//     { 'name': '新型', 'value': '12734670' }]


var ec_right2_option = {
    // backgroundColor: '#515151',
    title: {
        text: "百度热搜",
        textStyle: {
            color: 'white',
        },
        left: 'left'
    },
    tooltip: {
        show: true
    },
    series: [{
        type: 'wordCloud',
        gridSize: 1,
        sizeRange: [12, 55],
        rotationRange: [-45, 0, 45, 90],
        shape: 'circle',
        textStyle: {
            normal: {
                color: function () {
                    return 'rgb(' +
                        Math.round(Math.random() * 255) +
                        ', ' + Math.round(Math.random() * 255) +
                        ', ' + Math.round(Math.random() * 255) + ')'
                }
            },
            emphasis: {
                shadowBlur: 30,
                // shadowColor: '#333',
                shadowColor: '#02a6b5',
              },
        },
        left: 'center',
        top: '15%',
        width: '90%',
        height: '80%',
        right: null,
        bottom: null,
        data: [],
        // data:dd
    }]
}

ec_right2.setOption(ec_right2_option);

window.addEventListener("resize", function () {
    ec_right2.resize();
});

ec_right2.on('click', function (param) {
    console.log(param)
    if (typeof param.seriesIndex != 'undefined') {
        window.location.href = "https://top.baidu.com/board?tab=realtime";
    }
    
})

